<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	template="/pages/templates/template.xhtml">

	<ui:define name="meio">
		<ui:include src="menu.xhtml" />
	</ui:define>

	<ui:define name="centro">
		<h:form id="formproc">
			<table>
				<tr>
					<td><h:outputText value="Categoria:" /></td>
					<td colspan="2"><h:outputText
							value="Palavra que contenha no resumo:" /></td>
				</tr>
				<tr>
					<td><h:selectOneMenu id="categoria" label="categoria"
							class="ui-selectonemenu-label ui-inputfield ui-corner-all"
							value="#{procurarMB.categoria}" required="true"
							requiredMessage="Campo Categoria necess&#225;rio.">
							<f:selectItem itemLabel="Selecione uma categoria." />
							<f:selectItems value="#{pageControl.categorias}" />
						</h:selectOneMenu></td>

					<td><p:inputText value="#{procurarMB.res}" /></td>
					<td><h:commandButton value="Procurar"
							action="#{procurarMB.procuraCriaLista}" update=":lista" /></td>
				</tr>
			</table>

			<p:scrollPanel mode="native" style="width:100%;height:390px">
				<p:dataGrid var="topicos" id="lista" value="#{procurarMB.list}"
					columns="1">
					<p:panel header="#{topicos.titulo}" style="width:100%">
						<h:panelGrid columns="2">
							<h:outputText value="Resumo: " style="font-weight: bold" />
							<h:outputText value="#{topicos.resumo}" />
							<h:outputText value="Veja mais, clique " />
							<h:commandLink action="busca" value="aqui" actionListener="#{procurarMB.limpa}">
								<f:param name="id" value="#{topicos.id}" />
							</h:commandLink>
						</h:panelGrid>
					</p:panel>
				</p:dataGrid>
			</p:scrollPanel>
		</h:form>
	</ui:define>

</ui:composition>
